package cn.jiyun.entity;

import lombok.Data;

/**
 * @Author weiyuanhang
 * @data: 2023/8/8 000811:36
 * @Package cn.jiyun.entity
 * @email 3185757326@qq.com
 */
@Data
public class Result<T> {
    private String code;
    private String message;
    private T data;
    public static Result ok(Object data){
        Result<Object> result = new Result<>();
        result.setCode("1");
        result.setMessage("成功");
        result.setData(data);
        return result;
    }
    public static Result error(){
        Result<Object> result = new Result<>();
        result.setCode("2");
        result.setMessage("失败");
        return result;
    }
}
